def inp():
    n = int(input())
    return n

def make_first(n):
    return list(range(1,n+1))

def make_next(last_line):
    ans = []
    temp = []
    for i in range(0,len(last_line),2):
        temp.append(last_line[i + 1])
        temp.append(last_line[i])
        ans += temp
        temp = []
    return ans[:]
        
    
def make_next_next(last_last_line):  
    ans = []
    temp = []
    for i in range(0,len(last_last_line),4):
        temp.append(last_last_line[i + 2])
        temp.append(last_last_line[i + 3])
        temp.append(last_last_line[i + 0])
        temp.append(last_last_line[i + 1])
        ans += temp
        temp = []
    return ans[:]


def make(n):
    ans_l = []
    ans_l.append(make_first(n))
    it = 0
    for i in range(1,n//2):
        if i % 2 == 1:
            ans_l.append(make_next(ans_l[it]))
        else:
            ans_l.append(make_next_next(ans_l[it]))
            it += 2
    return ans_l[:]


def main():
    n = inp()
    print(make(n))
    
main()